<?php

class AboutcountryController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
       	$this->_helper->layout->setLayout('layout');
		Zend_Loader::loadFile("../application/default/models/Aboutcountry.php");
		$model_aboutcountry = new Aboutcountry(); 
    }

    public function viewAction()
	{
		//$this->_helper->layout->setLayout('layout');                
		Zend_Loader::loadFile("../application/default/models/Tour.php");
		Zend_Loader::loadFile("../application/default/models/Aboutcountry.php");
		$model_aboutcountry = new Aboutcountry();
		$request = $this->getRequest();
		$page_id = $request->getParam('page_id', 0);
		$rec_arr = $model_aboutcountry->getPageDetailsByCategory($page_id);
		$this->view->rec_arr = $rec_arr;
                $breadcrumb= Array ("0" =>Array("title" => "Home", "url" => "/index/" ), "1"=>Array("title"=>"About Sri Lanka", "url"=>"") );
		$this->view->breadcrumb()->set($breadcrumb);		
                $camp_arr = $model_aboutcountry->getCampaignDetailsBynationalparrk($page_id);
               //  print_r($camp_arr);
		$this->view->camp_arr = $camp_arr;
		$sess = new Zend_Session_Namespace('locale');
        $curr_lang = $sess->current_lang;
        if($curr_lang != '')
        {
            $lang = $curr_lang;
        } else {
    	    $lang = 'en';
	    }
	    
	    $this->view->lang = $lang;
	}
	
	public function detailsAction()
	{
		Zend_Loader::loadFile("../application/default/models/Tour.php");
		Zend_Loader::loadFile("../application/default/models/Aboutcountry.php");
		$model_aboutcountry = new Aboutcountry();
		$request = $this->getRequest();
		$page_id = $request->getParam('page_id', 0);
		$rec_arr = $model_aboutcountry->getPageDetailsById($page_id);
		$this->view->rec_arr = $rec_arr;
                $breadcrumb= Array ("0" =>Array("title" => "Home", "url" => "/index/" ), "1"=>Array("title"=>$this->view->translate('%' . $rec_arr['title'], 'map'), "url"=>"") );
                $this->view->breadcrumb()->set($breadcrumb);	
		$sess = new Zend_Session_Namespace('locale');
        $curr_lang = $sess->current_lang;
        if($curr_lang != '')
        {
            $lang = $curr_lang;
        } else {
    	    $lang = 'en';
	    }
	    
	    $this->view->lang = $lang;
	}

	public function mapAction() 
    {
        $breadcrumb= Array ("0" =>Array("title" => "Home", "url" => "/index/" ), "1"=>Array("title"=>$this->view->translate('%View Map','topnav'), "url"=>"") );
        $this->view->breadcrumb()->set($breadcrumb);		
    	Zend_Loader::loadFile("../application/default/models/Tour.php");
    	Zend_Loader::loadFile("../application/default/models/Aboutcountry.php");
    	$mod_abtcountry = new Aboutcountry();
    	$rec_arr = $mod_abtcountry->listMapContentAboutCountry();
        
    	$this->view->rec_arr = $rec_arr;
    	$sess = new Zend_Session_Namespace('locale');
        $curr_lang = $sess->current_lang;
        if($curr_lang != '')
        {
            $lang = $curr_lang;
        } else {
    	    $lang = 'en';
	    }
	    
	    $this->view->lang = $lang;
    }
    
    public function aboutcountryAction()
    {
    	$this->_helper->layout()->disableLayout();
    	
    	$request = $this->getRequest();
    	$link = $request->getParam(base64_encode('link'));
    	
    	switch ($link)
    	{
    		case base64_encode('about') :
    			$this->render("about-sl-01");
    			break;
    			
    		case base64_encode('geography') :
    			$this->render("about-sl-02");
    			break;
    		case base64_encode('population') :
    			$this->render("about-sl-03");
    			break;
    		case base64_encode('important_fact') :
    			$this->render("about-sl-04");
    			break;
    		case base64_encode('tipping') :
    			$this->render("about-sl-05");
    			break;
    		case base64_encode('working_time') :
    			$this->render("about-sl-06");
    			break;
    		case base64_encode('cuisine') :
    			$this->render("about-sl-07");
    			break;
    		case base64_encode('festivals') :
    			$this->render("about-sl-08");
    			break;
    		case base64_encode('visa') :
    			$this->render("about-sl-09");
    			break;
    		case base64_encode('transport') :
    			$this->render("about-sl-10");
    			break;
    		case base64_encode('recommended_travel') :
    			$this->render("about-sl-11");
    			break;
    		case base64_encode('foreign_trade') :
    			$this->render("about-sl-12");
    			break;
    		case base64_encode('tourism') :
    			$this->render("about-sl-13");
    			break;
    		case base64_encode('flora_fauna') :
    			$this->render("about-sl-14");
    			break;
    		case base64_encode('entertainment') :
    			$this->render("about-sl-15");
    			break;    		
    		case base64_encode('useful_tips') :
    			$this->render("about-sl-16");
    			break;
    	}
    }
}